package com.wwwarehouse.resource_center.bean.goods;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Joseph on 2017/9/27.
 *         <p/>
 */

public class InfomationBean implements Parcelable {


    /**
     * address : {"area":"xxx","country":"yyy","detail":"测试内容l9i8","gsMapPoint":{"x":100,"y":200,"z":300}}
     * attributeList : [{"name":"xxx1","value":"yyy1"}]
     * identifyList : [{"name":"xxx1","value":"yyy1"}]
     * introduction : 测试内容4en8
     * labelList : [{"name":"xxx1"}]
     * mediaList : [{"name":"xxx1","type":68882,"url":"http://xx/1"}]
     * name : xxx
     * type : 测试内容x35m
     */

    private AddressBean address;
    private String introduction;
    private String name;
    private String type;
    private List<AttributeListBean> attributeList;
    private List<IdentifyListBean> identifyList;
    private List<LabelListBean> labelList;
    private List<MediaListBean> mediaList;

    public AddressBean getAddress() {
        return address;
    }

    public void setAddress(AddressBean address) {
        this.address = address;
    }

    public String getIntroduction() {
        return introduction;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public List<AttributeListBean> getAttributeList() {
        return attributeList;
    }

    public void setAttributeList(List<AttributeListBean> attributeList) {
        this.attributeList = attributeList;
    }

    public List<IdentifyListBean> getIdentifyList() {
        return identifyList;
    }

    public void setIdentifyList(List<IdentifyListBean> identifyList) {
        this.identifyList = identifyList;
    }

    public List<LabelListBean> getLabelList() {
        return labelList;
    }

    public void setLabelList(List<LabelListBean> labelList) {
        this.labelList = labelList;
    }

    public List<MediaListBean> getMediaList() {
        return mediaList;
    }

    public void setMediaList(List<MediaListBean> mediaList) {
        this.mediaList = mediaList;
    }

    public static class AddressBean implements Parcelable {
        /**
         * area : xxx
         * country : yyy
         * detail : 测试内容l9i8
         * gsMapPoint : {"x":100,"y":200,"z":300}
         */
        private String address="";   //详细地址
        private String city ="";   //城市
        private String area="";  //
        private String country="";//国家
        private String distinct="";//区
        private String detail="";
        private String province="";  //省份
        private GsMapPointBean gsMapPoint;

        public String getProvince() {
            return province;
        }

        public void setProvince(String province) {
            this.province = province;
        }

        public String getAddress() {
            return address;
        }

        public void setAddress(String address) {
            this.address = address;
        }

        public String getCity() {
            return city;
        }

        public void setCity(String city) {
            this.city = city;
        }

        public String getDistinct() {
            return distinct;
        }

        public void setDistinct(String distinct) {
            this.distinct = distinct;
        }

        public static Creator<AddressBean> getCREATOR() {
            return CREATOR;
        }

        public String getArea() {
            return area;
        }

        public void setArea(String area) {
            this.area = area;
        }

        public String getCountry() {
            return country;
        }

        public void setCountry(String country) {
            this.country = country;
        }

        public String getDetail() {
            return detail;
        }

        public void setDetail(String detail) {
            this.detail = detail;
        }

        public GsMapPointBean getGsMapPoint() {
            return gsMapPoint;
        }

        public void setGsMapPoint(GsMapPointBean gsMapPoint) {
            this.gsMapPoint = gsMapPoint;
        }

        public static class GsMapPointBean implements Parcelable {
            /**
             * x : 100
             * y : 200
             * z : 300
             */

            private int x;
            private int y;
            private int z;

            public int getX() {
                return x;
            }

            public void setX(int x) {
                this.x = x;
            }

            public int getY() {
                return y;
            }

            public void setY(int y) {
                this.y = y;
            }

            public int getZ() {
                return z;
            }

            public void setZ(int z) {
                this.z = z;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeInt(this.x);
                dest.writeInt(this.y);
                dest.writeInt(this.z);
            }

            public GsMapPointBean() {
            }

            protected GsMapPointBean(Parcel in) {
                this.x = in.readInt();
                this.y = in.readInt();
                this.z = in.readInt();
            }

            public static final Creator<GsMapPointBean> CREATOR = new Creator<GsMapPointBean>() {
                @Override
                public GsMapPointBean createFromParcel(Parcel source) {
                    return new GsMapPointBean(source);
                }

                @Override
                public GsMapPointBean[] newArray(int size) {
                    return new GsMapPointBean[size];
                }
            };
        }

        public AddressBean() {
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.address);
            dest.writeString(this.city);
            dest.writeString(this.area);
            dest.writeString(this.country);
            dest.writeString(this.distinct);
            dest.writeString(this.detail);
            dest.writeString(this.province);
            dest.writeParcelable(this.gsMapPoint, flags);
        }

        protected AddressBean(Parcel in) {
            this.address = in.readString();
            this.city = in.readString();
            this.area = in.readString();
            this.country = in.readString();
            this.distinct = in.readString();
            this.detail = in.readString();
            this.province = in.readString();
            this.gsMapPoint = in.readParcelable(GsMapPointBean.class.getClassLoader());
        }

        public static final Creator<AddressBean> CREATOR = new Creator<AddressBean>() {
            @Override
            public AddressBean createFromParcel(Parcel source) {
                return new AddressBean(source);
            }

            @Override
            public AddressBean[] newArray(int size) {
                return new AddressBean[size];
            }
        };
    }

    public static class AttributeListBean implements Parcelable {
        /**
         * name : xxx1
         * value : yyy1
         */

        private String name;
        private String value;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.name);
            dest.writeString(this.value);
        }

        public AttributeListBean() {
        }

        protected AttributeListBean(Parcel in) {
            this.name = in.readString();
            this.value = in.readString();
        }

        public static final Creator<AttributeListBean> CREATOR = new Creator<AttributeListBean>() {
            @Override
            public AttributeListBean createFromParcel(Parcel source) {
                return new AttributeListBean(source);
            }

            @Override
            public AttributeListBean[] newArray(int size) {
                return new AttributeListBean[size];
            }
        };
    }

    public static class IdentifyListBean implements Parcelable {
        /**
         * name : xxx1
         * value : yyy1
         */

        private String name;
        private String value;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.name);
            dest.writeString(this.value);
        }

        public IdentifyListBean() {
        }

        protected IdentifyListBean(Parcel in) {
            this.name = in.readString();
            this.value = in.readString();
        }

        public static final Creator<IdentifyListBean> CREATOR = new Creator<IdentifyListBean>() {
            @Override
            public IdentifyListBean createFromParcel(Parcel source) {
                return new IdentifyListBean(source);
            }

            @Override
            public IdentifyListBean[] newArray(int size) {
                return new IdentifyListBean[size];
            }
        };
    }

    public static class LabelListBean implements Parcelable {
        /**
         * name : xxx1
         */

        private String name;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.name);
        }

        public LabelListBean() {
        }

        protected LabelListBean(Parcel in) {
            this.name = in.readString();
        }

        public static final Creator<LabelListBean> CREATOR = new Creator<LabelListBean>() {
            @Override
            public LabelListBean createFromParcel(Parcel source) {
                return new LabelListBean(source);
            }

            @Override
            public LabelListBean[] newArray(int size) {
                return new LabelListBean[size];
            }
        };
    }

    public static class MediaListBean implements Parcelable {
        /**
         * name : xxx1
         * type : 68882
         * url : http://xx/1
         */

        private String name;
        private int type;
        private String url;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getType() {
            return type;
        }

        public void setType(int type) {
            this.type = type;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.name);
            dest.writeInt(this.type);
            dest.writeString(this.url);
        }

        public MediaListBean() {
        }

        protected MediaListBean(Parcel in) {
            this.name = in.readString();
            this.type = in.readInt();
            this.url = in.readString();
        }

        public static final Creator<MediaListBean> CREATOR = new Creator<MediaListBean>() {
            @Override
            public MediaListBean createFromParcel(Parcel source) {
                return new MediaListBean(source);
            }

            @Override
            public MediaListBean[] newArray(int size) {
                return new MediaListBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.address, flags);
        dest.writeString(this.introduction);
        dest.writeString(this.name);
        dest.writeString(this.type);
        dest.writeList(this.attributeList);
        dest.writeList(this.identifyList);
        dest.writeList(this.labelList);
        dest.writeList(this.mediaList);
    }

    public InfomationBean() {
    }

    protected InfomationBean(Parcel in) {
        this.address = in.readParcelable(AddressBean.class.getClassLoader());
        this.introduction = in.readString();
        this.name = in.readString();
        this.type = in.readString();
        this.attributeList = new ArrayList<AttributeListBean>();
        in.readList(this.attributeList, AttributeListBean.class.getClassLoader());
        this.identifyList = new ArrayList<IdentifyListBean>();
        in.readList(this.identifyList, IdentifyListBean.class.getClassLoader());
        this.labelList = new ArrayList<LabelListBean>();
        in.readList(this.labelList, LabelListBean.class.getClassLoader());
        this.mediaList = new ArrayList<MediaListBean>();
        in.readList(this.mediaList, MediaListBean.class.getClassLoader());
    }

    public static final Parcelable.Creator<InfomationBean> CREATOR = new Parcelable.Creator<InfomationBean>() {
        @Override
        public InfomationBean createFromParcel(Parcel source) {
            return new InfomationBean(source);
        }

        @Override
        public InfomationBean[] newArray(int size) {
            return new InfomationBean[size];
        }
    };
}
